function orderUser(){
    //标记是否从搜索页面转来
    var bool=true;
    try {
        var search=document.getElementById("search").value;
    }catch (error) {
        search="";
        bool=false;
    }
    var data=search;
    $.ajax({
        type:"post",
        dataType:"text",
        url:"/fp_war_exploded/orderUser",
        data:data,
        success:function (result) {
            selectMissionList=result;
            document.cookie="UserResults="+result;
            if(bool){
                //window.location.href="missionPlatform.html";
                showUsers();
            }
            //showSearchMission();
            //showMission();
            //alert("getMission.js success！"+result);
        },
        error:function () {
            alert("getMission:17Line Search error");
        }
    });
}
function createUser(Name,Energy) {
    var divForUser=document.getElementById("user");
    var name=document.createElement("p");
    var textName=document.createTextNode(Name);
    var energy=document.createElement("p");
    var textEnergy=document.createTextNode(Energy);

    name.appendChild(textName);
    energy.appendChild(textEnergy);
    divForUser.appendChild(name);
    divForUser.appendChild(energy);
}
function showUsers(){
    var UserList=document.cookie.split(";")[0].split("=")[1];
    if(UserList.trim()=="error"){
        return;
    }
    UserList=JSON.parse(UserList);
    for(var i=0;i<UserList.length;i++){
        createUser(UserList[i].name,UserList[i].energy);
    }
}
orderUser();